package Box2D.Common
{
	public class b2Color extends b2Wrapper
	{
		public function b2Color(wrapper:Object=null)
		{
			if(wrapper==null)
				wrapper = callDirect('b2Color_new');
			super(wrapper);			
		}
		public function Set(r:Number,g:Number,b:Number):void{
			call('b2Color_Set',r,g,b);
		}
		public function get r():int{return getNumber(0)*255.}
		public function set r(value:int):void{setNumber(0,value/255.)}
		public function get g():int{return getNumber(4)*255.}
		public function set g(value:int):void{setNumber(4,value/255.)}
		public function get b():int{return getNumber(8)*255.}
		public function set b(value:int):void{setNumber(8,value/255.)}
		
		public function get color() : uint{return (r << 16) | (g << 8) | (b);}
		public static function from(r:Number,g:Number,b:Number):b2Color{
			var clr:b2Color = new b2Color;
			clr.Set(r,g,b);
			return clr;
		}
	}
}